<?php
class Arm_Form_Element_Cnpj extends Zend_Form_Element
{
  public function init(){
    parent::init();

    $this ->addValidator(new Zend_Validate_Regex('/^\d{2}\.\d{3}\.\d{3}\/\d{4}\-\d{2}$/'));
    $this ->setOptions(array(
      'size'        => 19,
      'maxlength'   => 18,
      'onkeyup'     => 'formCgcMasc(this.id)',
      'onblur'      => 'validateCgc(this.id)',
    ));

    $this->addErrorMessage('CNPJ no formato inválido! Utilize, por exemplo, 99.999.999/9999-99');
    $this ->addFilter('StripTags');
    $this ->addFilter('StringTrim');
  }
}
